-
-
Notifications
You must be signed in to change notification settings - Fork 5.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Platform] Add platform pluggable framework #11222
Conversation
👋 Hi! Thank you for contributing to the vLLM project. Once the PR is approved and ready to go, your PR reviewer(s) can run CI to test the changes comprehensively before merging. To run CI, PR reviewers can do one of these:
🚀 |
df89a80
to
65b83e4
Compare
6b0a018
to
48a49bd
Compare
b43b61c
to
3ec575e
Compare
This comment was marked as outdated.
This comment was marked as outdated.
f31d075
to
1cb1934
Compare
189a199
to
a4b6e8c
Compare
a4b6e8c
to
beeecbf
Compare
This comment was marked as outdated.
This comment was marked as outdated.
beeecbf
to
464e184
Compare
464e184
to
2ec32cd
Compare
2ec32cd
to
1006d7c
Compare
fbf37c1
to
75eedc0
Compare
This PR is ready for review now. @DarkLight1337 @simon-mo @youkaichao |
75eedc0
to
d45c571
Compare
vllm/platforms/__init__.py
Outdated
def __getattr__(self, name): | ||
"""Get the attribute. If the attribute is not found, go pass to the | ||
current platform.""" | ||
if name == 'platform': | ||
return self.platform | ||
if name == 'initialize_current_platform': | ||
return self.initialize_current_platform | ||
# Go pass to the current platform. | ||
return getattr(self.platform, name) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To enable IDE autocompletion for the wrapped platform's methods, we might have to use TYPE_CHECKING
flag to provide more detailed type information separate from the real declaration of the class.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's hard to do statical type check to infer the reference of dynamical attributes returned by getattr.
I did a new way to implement the wrapper. CurrentPlatform
inherits from Platform
interface now. In this way, IDE autocompletion works.
d45c571
to
62b074a
Compare
3b404bc
to
f524313
Compare
.buildkite/test-pipeline.yaml
Outdated
- pip install -e ./plugins/vllm_add_dummy_model | ||
- pytest -v -s distributed/test_distributed_oot.py |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Although we probably can't move this because it needs distributed environment...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alternatively we can require 2 GPUs for the full Plugin Test pipeline.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, my mistake. Will update later to avoid wasting CI resource. Considered the plugin test is simple currently, let's do not waste CI resource. We can do it once plugin test is rich. I'll leave a note then
@youkaichao please also verify this when you are free. |
f300ced
to
735c0d1
Compare
Signed-off-by: wangxiyuan <[email protected]>
Signed-off-by: wangxiyuan <[email protected]>
735c0d1
to
dbd0113
Compare
thanks for the contribution! However, I think model runner is not mature enough to be exposed right now. I added #11602 to enable platform plugins, please help me review that pr, thanks! @wangxiyuan @MengqingCao |
See #11602 |
See RFC: #11162
This PR is the first step of the RFC. More PR will be added until reach the RFC goal.
What is Done:
PlatformRegister
class. Provide some APIs for plugin to register and initialize out-of-tree platformCurrentPlatform
wrapper to make sure thecurrent_platform
global var is always up-to-date.Some refactor should be done in other PRs, see #11162 (comment)
How to use:
vllm_new_device_plugin
.